package com.elin4it.blog.service;

import com.elin4it.blog.mapper.ConfigMapper;
import com.elin4it.blog.pojo.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * User:Elin
 * Date:2015/7/15
 * Description:
 */
@Service
public class ConfigServiceImpl implements ConfigService {

    @Autowired
    private ConfigMapper configMapper;

    //标题的键名
    private final String TITLE = "title";
    //副标题的键名
    private final String SUBTITLE = "subtitle";

    public String findTitle() throws Exception {

        //从数据库中查询标题
        Config title = configMapper.selectByPrimaryKey(TITLE);
        return title.getvValue();
    }

    public String findSubTitle() throws Exception {
        //从数据库中查询副标题
        Config title = configMapper.selectByPrimaryKey(SUBTITLE);
        return title.getvValue();
    }
}
